<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBooksTable extends Migration
{

    public function up()
    {
        Schema::create('books', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('author');
            $table->string('cover');    //封面
            $table->integer('wordCount');   //字数
            $table->string('introduction');   //简介
            $table->string('chapterPath');   //目录路径
            $table->string('source');   //数据来源
            $table->string('sourceId');   //数据该来源中的id
            $table->integer('popularity');   //在该数据源中此书的人气度
            $table->tinyInteger('status');   //状态 0：完结、1：连载、2:停更、-1：下架
            $table->tinyInteger('categoryId');   //一级分类：玄幻、都市、灵异等
            $table->tinyInteger('againCategoryId');   //二级分类：玄幻：东方大陆、异世大陆等
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('books');
    }
}
